﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class GameInit:MonoBehaviour
{
    GameObject _engineRoot;
    private void Start()
    {
        Init();
    }
    public void Init()
    {
        if (_engineRoot == null)
        {
            _engineRoot = new GameObject("GameEngine");
            GameObject.DontDestroyOnLoad(_engineRoot);
            _engineRoot.AddComponent<GameEngine>();
        }
        UIMgr.GetInstance().Init();

        ScenesManager.GetInstance().LoadSceneAsyn(SceneManager.GetActiveScene().buildIndex + 1, () =>
        {
            Debug.Log("加载Login页面");
            UIMgr.GetInstance().Add("UI/Login/LoginPanel");
        });
    }
}
